{extend name="base"}
{block name="div"}

<div id="main" style="width: 1300px;height:650px;margin:0 auto;background-color: antiquewhite;">
    <form action="http://jianfei.lightrain.org.cn/index/lrshiwu" method="post">


        食物名称：<input id="name" type="text" name="name" />
        食物缩写：<input id="suoxie" type="text" name="pinyin" />
        每100克食物热量（单位大卡/千卡）：<input type="text" name="reliang" />



        <button type="submit">提交</button>

    </form>

</div>

{/block}

{block name="js"}
    <script>
        $(document).ready(function () {
            $("#name").keyup(function () {
                var name = $(this).val()
                $.post("/index/getpinyin", {
                        name: name
                    },
                    function (data) {
                        $('#suoxie').val(data)
                    }
                );
            })
        })
    </script>

{/block}